<template>
    <van-skeleton title :row="3" />
    <div>
<van-nav-bar
  title="标题"
  left-text="返回"
  left-arrow
  @click-left="onClickLeft"
/>
<van-address-list
  v-model="chosenAddressId"
  :list="list"
  :disabled-list="disabledList"
  disabled-text="以下地址超出配送范围"
  default-tag-text="默认"
  @add="onAdd"
  @edit="onEdit"
/>
<div v-for="item in cartData">
    <van-swipe-cell>
  <van-card
    :price="item.goods.goods_price"
    :title="item.goods.goods_name"
  >
  <template #thumb>
    <div style="width: 160px;height: 60px;display: flex;">
        <van-checkbox v-model="item.checked"></van-checkbox>
        <img :src="item.goods.goods_big_logo?item.goods.goods_big_logo:'https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg'" alt="" style="width: 60px;height: 60px;">
    </div>
  </template>
  <template #num>
    <van-stepper v-model="item.value" theme="round" button-size="22" disable-input />
  </template>
  </van-card>
  <template #right>
    <van-button square text="删除" type="danger" class="delete-button" />
  </template>
</van-swipe-cell>

<van-cell-group>
  <van-cell title="单元格" :value="item.goods.goods_price" />
  <van-cell title="单元格" :value="item.goods.goods_name" />
  <van-cell title="单元格" :value="item.goods.goods_id" />
  <van-cell title="单元格" :value="item.goods.cat_id" />
  <van-cell title="单元格" :value="item.goods.goods_weight" />
  <van-cell title="单元格" :value="item.goods.add_time" />
</van-cell-group>
    </div>
    </div>
</template>

<script setup>
 const onClickLeft = () => history.back();
 import { ref } from 'vue';
import { showToast } from 'vant';

    const chosenAddressId = ref('1');
    const list = [
      {
        id: '1',
        name: '张三',
        tel: '13000000000',
        address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
        isDefault: true,
      },
      
    ];
    

    const onAdd = () => showToast('新增地址');
    const onEdit = (item, index) => showToast('编辑地址:' + index);
import { useCounterStore } from '@/stores/cart'
// 在组件内部的任何地方均可以访问变量 `store` ✨
const store = useCounterStore()
let cartData=ref([])
let cart=()=>{
    cartData.value=store.piniaCart
}
cart()
</script>

<style lang="scss" scoped>

</style>